package com.sunyzc.ebaotech.ybt.simulator.util;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class CoreUtil {
	public static String generateApplyCode(String sequenceNo, String cardCode, String versionNo) throws SQLException {
		String applyCode = null;

		return applyCode;
	}

	public static long getCardId(String cardCode, String versionNo) throws SQLException {
		Connection connection = null;
		ResultSet resultSet = null;
		PreparedStatement statement = null;
		long squenceType = 0;
		try {
			String sql = "select  PKG_LS_PUB_UTILS.F_GET_CARD_ID(?,?) from dual";
			connection = DBUtil.getConnection();
			statement = connection.prepareCall(sql);
			statement.setString(1, cardCode);
			statement.setString(2, versionNo);
			resultSet = statement.executeQuery();
			if (resultSet.next())
				squenceType = resultSet.getLong(1);
		} finally {
			DBUtil.closeQuietly(connection, resultSet, statement);
		}
		return squenceType;
	}
}
